//
//  ZHMainDetailController.m
//  ZHS_UCDemo
//
//  Created by Emrys on 2016/11/22.
//  Copyright © 2016年 Emrys. All rights reserved.
//

#import "ZHMainDetailController.h"

#import "ZHMainDetailTableViewCell.h"
#import "ZHMainDetailTitleHeader.h"

#import "ZHRequestManager.h"

static const NSString *kZHMainDetailCtlTitle = @"工程项目一览";

static const CGFloat kZHMainDetailTableRowHeight = 70;

@interface ZHMainDetailController ()

@end

@implementation ZHMainDetailController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = (NSString *)kZHMainDetailCtlTitle;
    
    [self setTable];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



#pragma mark - set
- (void)setTable {
    
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    
    self.tableView.estimatedRowHeight = kZHMainDetailTableRowHeight;
    self.tableView.rowHeight = UITableViewAutomaticDimension;
    
    [self.tableView registerNib:[UINib nibWithNibName: NSStringFromClass([ZHMainDetailTableViewCell class]) bundle:nil] forCellReuseIdentifier:(NSString *)kZHMainDetailTableViewCell];
    
    ZHMainDetailTitleHeader *mainDetailTitleHeader = [ZHMainDetailTitleHeader mainDetailTitleHeader];
    mainDetailTitleHeader.contentView.backgroundColor = [UIColor greenColor];
    self.tableView.tableHeaderView = mainDetailTitleHeader;
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

#pragma mark -
#pragma mark - UITableViewDelegate
#pragma mark - UITableViewDataSource
- (NSInteger)tableView:(ZHTableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 10;
}
- (ZHMainDetailTableViewCell *)tableView:(ZHTableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    ZHMainDetailTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:(NSString *)kZHMainDetailTableViewCell forIndexPath:indexPath];
    
    return cell;
}
@end
